home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Medal Software 3
/
Gold Medal Software - Volume 3 (Gold Medal) (1994).iso
/
netutils
/
cdn200.arj
/
CDN.DOC
< prev
next >
Wrap
Text File
|
1994-02-16
|
32KB
|
640 lines
CHANGE DIRECTORY / NETWORK (CDn) v2.00
Automatic drive mapping for your Novell network
Copyright by Barry Brevik 1993, 1994 all rights reserved
711 Calle Cardo
Thousand Oaks, CA 91360
CIS 70132,2277
Novell and NetWare are registered trademarks of Novell, Inc.
Microsoft is a registered trademark and Windows is a trademark of Microsoft
Corporation.
CDn is not in the public domain- see SHAREWARE NOTICE below.
This user's guide dated February 14, 1994
OVERVIEW
CDn is a Novell NetWare specific application that makes it easy for anyone
to automatically map and de-map network drives, including SEARCH drives,
from inside a batch file or from the command line. CDn delivers all of the
drive mapping capability that most users will ever need while providing
many functions not found in the NetWare MAP command. CDn boasts all of
these features:
Map a new drive and switch to it with one command. This is useful both at
the command line and in batch files. Don't worry about drive letters, CDn
will automatically select the first available drive or re-map a current
drive- it's your choice.
Add and remove SEARCH drives even when shelled out from one or more parent
programs.
Save and restore entire drive maps. You can save a drive map, obliterate
the current maps, start a new series of maps for specific applications, and
then restore the original maps all using only CDn.
Map any user's SYS:MAIL directory by knowing only the user name.
Map the current user's SYS:MAIL directory WITHOUT knowing the name.
Map non-existent or even valid LOCAL drives to a network path.
Map any specific drive letter as a normal or a SEARCH drive.
Add a FAKE ROOT or SEARCH DRIVE status to any drive.
The MAP SEARCH and the MAP ROOT switches work in conjunction with all of
the CDn command line options so you can create numerous useful mapping
situations such as adding a user's SYS:MAIL directory as a SEARCH drive
with a fake root.
INSTALLATION
To install CDn, copy it to a drive and directory that will always be in
your path. My method is to place it in both a common network directory
such as SYS:PUBLIC and on each node's local disk, since CDn works whether
you are logged in or not.
page 1
HOW TO USE CDn
All of CDn's functions are detailed in this document, but you can get
started right away by reading the short command summary and examples below.
CDn's strong point is it's simplicity- users have even been known to find
it enjoyable. First, a few basic concepts and then on to some examples.
1) A CDn command consists of the program name "cdn" followed by either:
a network path (switches can optionally be added) or
a network username (switches can optionally be added) or
a drive letter in the range of A - Z followed by a network path
(e.g. "G:=SYS:\HOME") (switches can optionally be added) or
an absolute DOS path (e.g. "C:\DOS") or
one or more switches alone without a network path.
A network path consists of three parts: the file server, the volume and
the path. For example-
FS1/SYS:HOME or \\FS1\SYS\HOME\
FS1 is the file server name (optional)
SYS: is the NetWare volume name.
HOME is the path name.
The file server name is always optional with CDn. If you do not have a
multiple file server environment, you do not need the prefix. If you do
have multiple file servers and you omit the prefix, CDn will perform it's
actions using the current default file server as it's venue.
2) You can add the following switches to any CDn command to enhance the
scope of that command. These switches are used in combination with other
command line options but never by themselves.
-N Forces the creation of a NEW drive.
-NS Creates a SEARCH drive (New Search).
-R Creates a FAKE ROOT.
These switches can appear in any order and be upper, lower or mixed case.
You can combine any of these switches, but do not use both -N and -NS on
the same command line... -NS combines the NEW and SEARCH functions.
3) By default, CDn will try to re-map an existing drive that is already
mapped to the target volume. In other words, if drive G: is mapped as
"sys:public\apps\wordproc", and you enter "cdn sys:public\mail", then CDn
will re-map drive G: as "sys:public\mail". This feature prevents you from
quickly depleting the supply of drive letters. You can force CDn to map an
unused drive letter by using the "-N" switch . If there is no existing
drive mapped to the target volume, CDn will use a new drive letter auto-
matically, even without the "-N" switch.
4) When CDn re-maps an existing drive or maps a previously unused (new)
drive, it also makes that drive and path the current path... in other
words, it "switches" to the target path. This is supremely useful in batch
page 2
files. An exception is when you add the SEARCH drive modifier. When you
create a SEARCH drive, CDn adds it to your path and updates the NetWare
shell's internal SEARCH table, but it maintains the current path without
"switching". Updating the shell's SEARCH table is required to ensure that
LOGOUT properly removes your SEARCH drives.
5) The display output of CDn can be routed to a text file or printer using
standard DOS redirection like this:
cdn sys:home\mary > maps.txt
This is important when you use the "@" function to restore a drive map.
6) If you want Cdn to "remember" new drive maps so that you can
automatically delete them later, you must load the companion utility,
CDnMEM (see "THE CDnMEM RESIDENT BUFFER" below). Cdn searches for the
presence of CDnMEM each time it runs.
OPERATING CDn - SOME EXAMPLES
cdn sys:home\jeff\backup Makes that path current on the default
file server.
cdn fs1/sys:home\jeff\backup Now add a specific file server.
cdn fs1/william Go to user WILLIAM's mail directory on a
specific file server.
cdn -m -ns -r Make the current user's mail directory be
a new SEARCH drive with a fake root.
cdn b:=sys:xfer\floppy Redefine non-existent local drive B: to
point to a directory on the file server.
cdn -dk Delete the map for drive "K:" (assuming
it exists).
cdn -d! Delete all drive maps and create 1 or 2
new maps as specified in the default path
option (see "SETTING THE DEFAULT PATH AND
SEARCH PATH" below).
cdn or cdn -sh This is like typing "map" except the out-
put is trimmed to show only network
drives. If you have a busy PATH set up,
this can be a nice feature. Any drives
with a fake root mapping will have the
message "[fake root]" appended. If CDnMEM
is loaded and contains any drive letters,
a message will appear showing what drives
are currently in the buffer. Generally,
if you see only one drive mapped and it
points to SYS:LOGIN, then you are not
logged to a file server.
cdn > c:\basemaps.txt Create a drive mapping script file
reflecting the current drive maps.
cdn @c:\basemaps.txt Delete all current drive maps and remap
new drives based on the script file
"basemaps.txt".
page 3
EXAMPLE- WHERE IS \LOGIN?
You have probably noticed that as you move from machine to machine, the
login drive changes, or if you login on drive F: then map a bunch of drives
and end up logging out on drive H:, your login drive is no longer F:- it
has become H: and F: is now invalid. You can use one of CDn's special
command line switches to handle this situation. Just enter "CDn -L" and
you will always land in the login directory whether you are already logged
in or not. Here is an example of a batch file that will put you or your
users into a tight login loop:
@ echo off
:top
cls
cdn -l ; find LOGIN drive and dir.
login ; execute the LOGIN program.
if errorlevel 1 goto lerror ; if LOGIN failed...
cdn -s ; check LOGIN status.
if errorlevel 1 goto top ; if not logged, start over.
who ; show version status and
pause ; capture status.
cdn -sh ; show drive maps.
goto end ; exit this batch.
:lerror ; if here, we failed to LOG IN.
pause ; pause to see error message.
goto top ; start over.
:end
Note how we use "cdn -s" to determine if we have successfully logged in.
We don't really need to change to SYS:SYSTEM but knowing that CDn will
return a non-zero errorlevel if we are not logged in allows us to use this
utility for an extra purpose.
MULTIPLE FILE SERVERS
If you are using CDn in a multiple file server environment, you can add the
file server name to the target path like this:
cdn fs2/sys:\public\messages
Just as with the MAP command, you must be attached to the target file
server before you can map any drives to it. If you are not attached, MAP
will stop and ask for a login name and password. In contrast, CDn was
designed to operate in batch files and will terminate with an error code if
you are not attached to the target server. Also note that CDn understands
the Universal Naming Convention (sometimes called "MS-NET") method of
specifying network paths. All of the following examples mean the same
thing to CDn:
fs1/sys:public
fs1\sys:public
\\fs1\sys\public\
page 4
COMMAND LINE OPTIONS
Here is a listing of the CDn special purpose switches. The first group of
switches should appear by themselves on the command line- in other words,
adding these switches to a network path would be an invalid command.
-L Changes to SYS:LOGIN on default file server. [-N |-NS |-R ]
-P Changes to SYS:PUBLIC on default file server. [-N |-NS |-R ]
-S Changes to SYS:SYSTEM on default file server. [-N |-NS |-R ]
-M Changes to the current user's SYS:MAIL directory on default file
server. [-N |-NS |-R ]
-Dx Deletes a drive mapping (including a SEARCH drive) where x is the
drive letter.
-D* Deletes ALL drive mappings.
-D! Deletes ALL drive mappings except those defined as the default map and
default SEARCH (see "SETTING THE DEFAULT PATH AND SEARCH PATH" below).
-SH SHows current network drive map list.
If CDnMEM is loaded...
-CL Clears the memory resident new drive list without deleting any drive
mappings.
-RM Removes all entries in the memory resident drive buffer and deletes
the corresponding drive mappings.
These switches are used in combination with other command line options but
never by themselves.
-N Forces CDn to use a NEW (not currently used) drive letter.
-NS CDn will use a NEW drive letter and make it a SEARCH drive. Note that
CDn does not switch to the new SEARCH drive.
-R CDn will make a "MAP ROOT" drive.
There is an additional command variant supported that will read drive
mappings out of an ASCII script file. When you use "CDn @filespec" all of
your current drive mappings will be deleted and the specified file will be
used to create a new series of drive maps. Use the redirection feature of
CDn to create the text file.
SETTING THE DEFAULT PATH AND SEARCH PATH
You can specify a network path to be the default drive map and SEARCH drive
map for use with the "-d!" switch. For example, if you select "SYS:HOME"
as the default path and "SYS:PUBLIC" as the default SEARCH path, when you
invoke "cdn -d!", all current drive maps will be deleted and two new drive
maps will be created as follows:
F: will be mapped to SYS:HOME
Z: will be a SEARCH drive mapped to SYS:PUBLIC
This is an example- the actual drive letters may be different on your PC.
You are not required to use both strings; either of them can be omitted to
meet your individual needs or both can be removed if you wish to disable
this function. Both strings are present by default and are set to
"SYS:PUBLIC". The strings are placed in the CDn executable and are located
near the end of the file. You can also edit the strings manually using
DEBUG or a hex editor. The default path is immediately preceded by the
string "DEFAULT PATH===>". The default SEARCH path is immediately preceded
page 5
by the string "DEFAULT SEARCH=>". Both strings are limited to 64
characters including a 0 termination byte.
Registered users will receive CDnFLG, a menu driven utility that lets you-
1) make changes to the DEFAULT PATH and SEARCH strings.
2) Toggle the "search for CDnMEM" flag.
3) Toggle the "show Shareware message" flag.
4) Change the four available command line switch characters.
DELETING DRIVE MAPS FROM A BATCH FILE
You might ask "what if I delete the current drive?". If you are running a
batch file, you have no way of determining if you are deleting the current
drive, so what happens? Nothing; the NetWare shell just makes another
drive current, usually a local drive. In any case, you don't have to worry
about being bumped to another drive after deleting a map because CDn can
always take you to a known location.
COMPATIBILITY
CDn coexists peacefully with the NetWare MAP command. Any drives created
with the MAP command can be remapped or deleted with CDn and any drives
created by CDn can be remapped or deleted with the MAP command. If you are
using the CDnMEM resident buffer, any drives deleted by MAP are
automatically removed from the buffer, but drives created by MAP are NOT
automatically added to the buffer.
THE CDnMEM RESIDENT BUFFER
CDn comes with a companion utility, CDnMEM.COM. This is an extremely
benign and well behaved TSR that uses only 256 bytes of RAM when resident.
CDnMEM does not grab any interrupt vectors, does not "pop-up" or in any
other way interact with the system. The sole purpose of CDnMEM is to
"remember" new drives that are created by CDn. Whenever CDn creates a NEW
drive letter, it adds that drive to the resident buffer. CDnMEM is istalled
by typing "cdnmem /i" on the command line (or in your AUTOEXEC.BAT file).
Because it is so unobtrusive, CDnMEM can be uninstalled at any time by
typing "cdnmem /u" even if other TSR's have been loaded on top of it. You
can also install CDnMEM at the beginning of a batch file, use CDn to map
and remove drive letters, and then uninstall it as you exit the batch file.
CDnMEM will not install another copy of itself if it has already been
loaded. When CDnMEM is loaded, there are two additional switches available
to CDn-
The "-RM" switch will ReMove (un-map) any drive mappings that are retained
in the resident buffer.
The "-CL" switch will CLear any drives in the resident buffer- in other
words, it will reset the buffer to blanks but it will not un-map any of the
drives. This is useful when you want to create and delete drive mappings
in a batch file and you want to be sure you are starting with a blank
slate. Just add this command to the start of your batch file.
CDnMEM can be loaded high if your DOS version or memory manager software
(such as QEMM) supports a loadhi function. See your DOS manual or memory
manager documentation for an explanation of how to load programs high.
page 6
If you are not using CDnMEM, you may want to use CDnFLG to set the "search
for CDnMEM" flag to false. This will force Cdn to NOT check for the
presence of CDnMEM every time it runs.
WHAT ABOUT THE VLM SHELLS?
CDn will work with the VLM shells provided that the module NETX.VLM is
loaded. If the NETX module is not loaded, CDn will return with the message
"NetWare shell not loaded". A major goal for the next version of CDn is to
support the VLM shells directly.
A WORD ABOUT WINDOWS
If you are using Microsoft Windows you can use CDn in a DOS window with no
problem. By default, Windows tries to isolate tasks from each other which
results in some strange behavior- if you create a new drive with CDn or
MAP in a DOS box, that drive will not be available to any other Windows
tasks, and when you quit Windows, any drives you created will have
disappeared. Sometimes, this might seem like a nice feature, but if you do
want to share your drive maps across Windows tasks, you can change the
default by editing your SYSTEM.INI file. You can edit this file by
clicking on FILE/RUN from Program Manager, type SYSEDIT on the command
line, and click OK. Four cascaded windows will appear- click on the one
titled SYSTEM.INI. Search for the heading [NetWare]. If you can not find
it, just add it to the end of the file. Add the following line to share
drive maps between tasks.
[NetWare]
NWSHAREHANDLES=TRUE
Add the following line to retain drive maps you have created or deleted
when you leave Windows.
RESTOREDRIVES=FALSE
If you use CDnMEM, you should load it before starting Windows. Since you
can only load one copy of CDnMEM, trying to load it repeatedly from
multiple DOS sessions will fail. When you use CDnMEM from a DOS session,
also note that all DOS windows share the same resident buffer, so if you
add drive G: (for example) from DOS session 1, it will appear in the
resident buffer of DOS session 2 even if drive G: does not exist in that
session. This is not necessarily a problem, but you should be aware of
this behavior in case you normally run more than 1 simultaneous DOS
session.
USING CDn IN LOGIN SCRIPTS
You can use CDn in NetWare login scripts. Just add a line to your login
script like this (for example, assuming CDn.COM is located in SYS:PUBLIC):
#sys:public\cdn sys:\
There is no reason to do this- LOGIN.EXE handles drive mapping internally,
and my tests have shown that the LOGIN process is marginally faster if you
let LOGIN.EXE do the mapping.
page 7
SWITCH CHARACTERS
You can use the "/", "-", "#" or ";" as a switch character when specify-
ing command line options. These switches can be changed with the CDnFLG
utility distributed to registered users.
ABSOLUTE AND RELATIVE PATHS
CDn also handles relative paths and paths with drive letters just like the
"CD" command. CDn however, will change both the drive and the path at the
same time. These are all valid CDn commands (provided the drives and paths
exist):
cdn c:\windows
cdn ..\..\users
cdn \windows\system
Note that the relative path format "cdn windows" is not supported- if a
path does not start with a file server name, volume name, drive letter,
".", or "\" CDn assumes you are asking for a user's mail directory.
MESSAGES
In normal use, CDn displays very few informational messages. If an error
occurs however, there are several error messages that may be displayed.
All error messages also result in a non zero DOS errorlevel return inside
a batch file. The following is a list of possible messages.
INFORMATIONAL MESSAGES (no error)
New drive mapped as X:
Any time CDn maps a previously unused drive letter this message will
be displayed replacing "X" with the actual drive letter.
The mapping for drive X: has been deleted.
Any time you delete a drive map with the "-d" or the "-r" switch this
message will be displayed replacing "X" with the actual drive letter.
Resident buffer has not been loaded.
Resident buffer was empty- no drive mappings have been deleted.
Resident buffer was already clear.
Resident buffer has been cleared only- no drive mappings have been deleted.
These messages will appear when you invoke CDn with the "-r" or the
"-c" switch and the CDnMEM buffer is either not loaded or is empty.
ERROR MESSAGES, COMMON
User not logged in.
Specified path is invalid.
NetWare shell is not loaded.
Specified volume is invalid - volume names have a maximum of 16 characters.
Specified volume does not exist.
Specified file server is invalid.
You are not attached to known file server FS2
Cannot map NEW drive... all permanent drives are currently mapped.
Cannot map SYS: volume... all available drives are mapped either as SEARCH
drives, or to a volume other than SYS:.
Cannot map target volume... all available drives are mapped either as
SEARCH drives, or to a volume other than the target.
No such user in Bindery - JAMES
User does not have a mail directory - JAMES
drive is not in the range "A-Z".
drive is not a network drive.
page 8
ERROR MESSAGES, UNCOMMON
With the exception of the "NetWare shell not loaded" message, I have never
seen these messages except under simulated error conditions.
Must be running NetWare v2.10 or better.
Must have NetWare shell v3.01 or better.
Insufficient memory to run.
Existing network drive found, but CDn could not make that drive current.
Unable to map drive X:
Cannot delete mapping for drive J:...
You are connected, but not attached to the specified file server.
Specified drive does not exist.
Could not allocate space in resident memory buffer.
RELIABILITY
CDn has been tested extensively on a NetWare v3.12/v2.15 dual file server
system- this is a 35 user production network on which CDn has been in daily
use for about one year at the time of this writing. CDn has also had
limited testing under NetWare 2.2, 3.11 and 4.01. CDn has been tested
under several workstation OS versions including MSDOS 3.3, 4.01, 5.0, 6.0
and 6.2. Final testing was performed by myself on the 43 file server WAN
at ABC studios in Hollywood, CA.
CDn has CTRL/C and CTRL/BREAK handlers to avoid the unpleasant results of
unexpected termination. In keeping with the intent of a batch file
utility, there are no messages which require a keystroke to clear. Even
the "usage" message which has multiple screens will pause for 2 seconds
between screens, and will then automatically continue.
DOS ERRORLEVEL RETURNS
Here is a list of the possible errorlevel return codes. Most of the time,
you will probably not need (or want) to get this detailed. Personally, I
check for errorlevel = 1 which will trap them all.
1 insufficient DOS version.
2 insufficient memory.
3 syntax error (shows USAGE message).
4 NetWare shell is not loaded.
5 user is not logged.
6 insufficient NetWare OS or NetWare shell version.
7 invalid file server.
8 you are not attached to target server.
9 undefined.
10 invalid volume.
11 user has no mail directory.
12 path is invalid.
13 could not map.
14 no free drives.
SYSTEM REQUIREMENTS
To run CDn, your file server(s) and workstations must meet the following
conditions:
Workstation must be running MSDOS v3.0 or better.
NetWare shell must be v3.01 or better.
File server must be running Advanced NetWare v2.10 or better.
page 9
SHAREWARE NOTICE
CDn is copyrighted software distributed as shareware and may be used on a
30-day free trial basis. If at the end of 30 days you find CDn to be
useful and you wish to continue it's use, you must register your copy based
on the fee plan shown below.
When you register, you will receive a diskette containing the latest
version of CDn as well as the utility CDnFLG that allows you to set the Cdn
internal flags and to set the default path and search path strings.
Registered users will also receive a free upgrade to the next release of
Cdn as soon as it is available.
Shareware disk and CD-ROM vendors, user groups, computer clubs, bulletin
board systems and individuals are permitted to copy and distribute CDn for
others to try on a 30-day free trial basis, provided that the program is
unmodified and is accompanied by this user's guide. A reasonable fee may
be charged for media, copying, and shipping and handling.
HOW TO REGISTER
To register your copy of CDn send your name and the address where you
receive U.S. mail together with your payment to:
Barry Brevik
711 Calle Cardo
Thousand Oaks, CA 91360
Please specify the diskette size you want (5.25" or 3.5"). You may pay by
cash, check, money order, or postal money order, in U.S. dollars. Checks
and money orders must be drawn on a U.S. bank.
+-----------------------------------------+--------+
| Fee schedule | Price |
+-----------------------------------------+--------+
| 1 or 2 file servers, unlimited users | $24.00 |
+-----------------------------------------+--------+
| 3 or more file servers, unlimited users | $39.00 |
+-----------------------------------------+--------+
SUPPORT POLICY
Registered users of CDn are entitled to support at no additional cost for a
minimum of three months from the date of registration. Within this time,
the author, when contacted via CompuServe or U.S. mail will answer
questions regarding the use of CDn and will attempt to correct any failure
by CDn to function as described in this user's guide. If during the three
month period the problem cannot be corrected, even if that problem is
caused by an incompatibility in the user's specific hardware or software
environment, the user may request and will receive a full refund of the
registration fee.
DISCLAIMER
The author disclaims all warranties, expressed or implied, including but
not limited to implied warranties of merchantability or fitness for a
particular purpose, with respect to CDn, the accompanying documentation and
any other computer programs that appear as part of the distribution
package. In no event shall the author be liable for any damages, direct or
consequential, resulting from the use, misuse or inability to use this
product, even if the author has been advised of the possibility of such
damages.
page 10
FEEDBACK
Comments, criticisms, and suggestions regarding the current product and
possible future enhancements to CDn are welcome. Please send any
communications to the address or CompuServe account shown at the end of
this document.
PROGRAMMER'S NOTES
Both CDn, CDnMEM and all the programs in the distribution package were
written entirely in Assembly Language. Why? My personal feeling is that
small utilities should BE small. Although I program a variety of languages
in my daily work, my favorite medium has always been MASM. MASM is great
for small projects like this, however, there is a lot going on inside CDn-
it weighs in at just a little over 6800 lines of source code! With CDn, I
felt that execution speed was less important than size on disk and in
memory, so I concentrated my efforts in that area, and MASM lets me keep
very tight control of wasted space.
ACKNOWLEDGMENTS
During the development of this utility, several people were very helpful to
me in offering their unselfish support, ideas and camaraderie. I would
like to thank the following individuals:
My wife, Cindy for encouragement, support and letting me work until
the wolf's hour.
Lawrence Couey of Novell Labs for pointing out in excruciating
detail my biggest mistake.
Brett Warthen of Infinite Technologies for his untiring support on
the CompuServe Netwire forums.
Steven Key of the University of Wisconsin-Whitewater for shining a
light on an area I thought was already bullet proof.
Tom Ruby of Legal File Software for giving me an important clue
if I had only been sharp enough to realize it.
William D. Cotten for giving it the critical eye.
Elaine Pate for providing a truly impressive test platform.
Greg Horton of SMTEK, INC for believing in me and allowing me to
make this utility public.
All of the sysops on the Netwire forum for making it the best
support forum in the world.
The author of CDn can be reached at:
Barry Brevik
711 Calle Cardo
Thousand Oaks, CA 91360
or on CompuServe at: CIS account 70132,2277
or on the Internet at: 70132.2277@compuserve.com
page 11